package vue;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.ByteOrder;

import javax.imageio.ImageIO;
import javax.imageio.stream.IIOByteBuffer;
import javax.imageio.stream.ImageInputStream;

import javax.swing.JPanel;

import controleur.CTheme;



@SuppressWarnings("serial")
public class VMenuItem extends JPanel {

	protected int lvl;
	protected BufferedImage imgItem;
	protected VRootWindow rootWin;
	
	public VMenuItem(VRootWindow rw, int level) {
		lvl = level;
		rootWin = rw;
		try {
			imgItem = ImageIO.read(getClass().getResourceAsStream("lvl"+lvl+".png"));
		} catch (Exception e) {
			
		}
		setPreferredSize(new Dimension(imgItem.getWidth(), imgItem.getHeight()));
		addMouseListener(new CTheme(rootWin, lvl));
	}
	
	@Override
	public void paintComponent(Graphics g) {
		g.drawImage(imgItem, 0, 0, null);
	}
	
	
}
